home *** CD-ROM | disk | FTP | other *** search
- Path: cypher.3do.com!user
- From: tsw@3do.com (Tom Watson)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2
- Subject: Number representation (was: Hungarian notation - whoops!)
- Date: Wed, 14 Feb 1996 19:20:17 -0800
- Organization: The 3DO Corporation
- Distribution: world
- Message-ID: <tsw-1402961920170001@cypher.3do.com>
- References: <30C40F77.53B5@swsbbs.com> <Pine.HPP.3.91.960124153551.24374C-100000@zeezrom.cs.byu.edu> <4e7ifl$et3@goanna.cs.rmit.EDU.AU> <Pine.HPP.3.91.960129133429.8419C-100000@foggy.cs.byu.edu> <4em29qINN39r@keats.ugrad.cs.ubc.ca> <Pine.HPP.3.91.960201015336.17360C-100000@clear.cs.byu.edu> <4f41vf$g8j@goanna.cs.rmit.EDU.AU> <Pine.HPP.3.91.960205124102.18647E-100000@warm.cs.byu.edu> <4fc157$jsf@goanna.cs.rmit.EDU.AU> <dewar.823793746@schonberg> <4fms62$c0p@goanna.cs.rmit.EDU.AU>
- NNTP-Posting-Host: cypher.3do.com
-
- In article <4fms62$c0p@goanna.cs.rmit.EDU.AU>, ok@goanna.cs.rmit.EDU.AU
- (Richard A. O'Keefe) wrote:
-
- >
- > >By the way, S&M is of course the right representation of floating-point,
- > >using 2's complement for floating-point is a goof that only a designer
- > >not understanding fpt would make!
- >
-
- I'm not so sure. With sign & magnitude you get TWO representations of the
- same number (zero). Some may argue that the difference is that negative
- zero is what a very small negative number decays into, and positive zero
- is what a very small positive number decays into. My understanding of
- numbers (no, I'm not an expert at this!) is that zero is only ONE number
- (basically without sign). Most numbering systems (like two's complement
- integers) have put in the positive domain.
-
- I have worked on a computer that had its floating point numbers in two's
- complement form. It was a definition of convience (a negative number is
- represented as the two's complement of its corresponding postitve
- number). This definition (coupled with the fact that both floating point
- and fixed point used the same set of registers) allowed quite a few
- instructions to overlap (an instruction "load complement word" worked for
- either).
-
- The machine (obviously) was pre IEEE floating point numbers, but worked
- VERY well. All that was needed to be implemented were 8 (count 'em)
- floating point instructions (+, -, *, / in double & single). If a result
- underflowed (which raised an optional trap) the result decayed to zero,
- which usually gave proper results. Programs didn't need to test for
- multiple incantations of zero (which needs to be done with IEEE numbers if
- the hardware doesn't detect BOTH forms).
-
- As far as I can see, the only good thing (tm) that multiple (+ & -) zeros
- gets you is multiple infinities when you divide by it (which may be the
- object). As long as both positive and negative numbers exist, and there
- is SOME method of making a bit pattern happen for each of them that are
- defined, it probably doesn't mean much which bits are turned on (use gray
- code, I don't care). Just make sure that all the operations necessary are
- working, and give proper (documented) results.
-
- [boy am I going to get flamed for this......]
-
- --
- Tom Watson
- tsw@3do.com (Home: tsw@johana.com)
-